<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<style>
			div {
				margin: 100px auto;
				width: 400px;
			}
		</style>
		<script>
			function addr(v) {
				var picAddr = ["../img/baidu_web.png", "../img/google_web-444.png", "../img/taobao_shopping-446.png"];
				var netUrl = ["https://www.baidu.com", "http://www.google.cn", "https://www.taobao.com"];
				
				var count=parseInt(v.getAttribute("id"))
				document.getElementById("pic").src = picAddr[count];
				document.getElementById("form").firstElementChild.action = netUrl[count];
				//				var txt = v.nextElementSibling.innerHTML;
				//				if(txt == "百度") {
				//					document.getElementById("pic").src = picAddr[1];
				//					document.getElementById("form").firstElementChild.action = netUrl[1];
				//				} else if(txt == "谷歌") {
				//					document.getElementById("pic").src = picAddr[0];
				//					document.getElementById("form").firstElementChild.action = netUrl[0];
				//				} else {
				//					document.getElementById("pic").src = picAddr[2];
				//					document.getElementById("form").firstElementChild.action = netUrl[2];
				//				}
			}
			//			function google() {
			//				document.getElementById("pic").src = "../img/google_web-444.png";
			//				document.getElementById("form").firstElementChild.action="http://www.google.cn";
			//			}
			//			function baidu(){
			//				document.getElementById("pic").src="../img/baidu_web.png";
			//			}
			//			function taobao(){
			//				document.getElementById("pic").src="../img/taobao_shopping-446.png";
			//				document.getElementById("form").firstElementChild.action="https://www.taobao.com";
			//			}
		</script>
	</head>

	<body>
		<div id="form">
			<form action="https://www.baidu.com" method="get">
				<img src="../img/baidu_web.png" id="pic" />
				<input type="text" name="content" />
				<input type="submit" name="ccc" value="搜索" /><br />
				<input type="radio" name="c" checked="checked" onclick="addr(this)" id="0" /><span>百度</span>
				<input type="radio" name="c" onclick="addr(this)" id="1" /><span>谷歌</span>
				<input type="radio" name="c" onclick="addr(this)" id="2" /><span>淘宝</span>
			</form>
		</div>
	</body>

</html>